﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace PROJECT_BOMBER.BLL
{
    public class Ventilateur : ElementPhysique
    {

        #region Constructeur

        public Ventilateur(int x, int y, int widthair, int heightair) : base(x,y)
        {
            CaseAir = new Rectangle(x, y - heightair, widthair, heightair);
            WidthAir = widthair;
            HeightAir = heightair;
        }
        #endregion

        #region Rectangle Air

        public Rectangle CaseAir;

        int _widthAir;

        public int WidthAir
        {
            get { return _widthAir; }
            set { _widthAir = value; }
        }
        int _heightAir;

        public int HeightAir
        {
            get { return _heightAir; }
            set { _heightAir = value; }
        }

        #endregion

        #region Collision

        public void CollisionObjet(Character perso1)
        {
            Collision.Air(perso1, this);
            Collision.Solid(perso1, this);
        }

        #endregion



        #region Update

        public new void Update(Level level)
        {
            Position = level.Position + Positionbase;

            Onscreen();

            if (Visible)
            {
                Case = new Rectangle((int)Position.X, (int)Position.Y, Width, Height);
                CaseAir = new Rectangle((int)Position.X, (int)Position.Y - HeightAir, WidthAir, HeightAir);

                CurrentAnimation.Update(Case.X, Case.Y, new Vector2(0, 0), 1, false);
                //Animations.Air().Update(gametime, CaseAir.X, CaseAir.Y, new Vector2(5000, 0), 5000, true);
            }
        }

        #endregion
    }
}
